<!DOCTYPE html>
<html lang="en" th:replace="~{layout.html::layout(~{:: #content})}">
<body>

<div class="container-fluid" id="content">
    <div class="row">
        <div class="col-sm-3 col-md-2 sidebar">
            <ul class="nav nav-sidebar">
                <li><a href="index">借阅信息</a></li>
                <li><a href="students">学生列表</a></li>
                <li class="active"><a href="books">书籍列表</a></li>
            </ul>

        </div>
        <div class="col-sm-9 col-sm-offset-3 col-md-10 col-md-offset-2 main">
            <h2 class="sub-header">书籍列表</h2>
            <div class="btn-group" role="group" aria-label="...">
                <a href="add-book" class="btn btn-success">添加书目</a>
                <a href="modify-book-number" class="btn btn-primary">修改书籍数量</a>
            </div>
            <div class="table-responsive">
                <table class="table table-striped">
                    <thead>
                    <tr>
                        <th>书籍编号</th>
                        <th>书名</th>
                        <th>剩余数量</th>
                        <th>操作</th>
                    </tr>
                    </thead>
                    <tbody>
                    <tr th:each="book:${books}">
                        <td th:text="${book.getId()}">书id</td>
                        <td th:text="${book.getName()}">书名</td>
                        <td th:text="${book.getBookNumber()}">剩余数量</td>
                        <td>
                            <span>
                                <a th:href="'delete-book?id='+${book.getId()}" class="btn btn-xs btn-danger" >删除</a>
                            </span>
                        </td>
                    </tr>
                    </tbody>
                </table>
            </div>
        </div>
    </div>
</div>

</body>

</html>